<?php if(isset($_SESSION['user']['user_id']) && $_SESSION['user']['user_id']!=""){?>
<div class="col-md-8">
 <div class="main-content" id="main-content">
	<div class="sub-content">
		<div class="top-header page-header clearfix">
			<h1>Sell Offer Info</h1>
		</div>
		<div class="top-links btn-active3">
			<ul class="form-progress-bar">
				 <?if(isset($_GET['product_id']) && $_GET['product_id']!=""){?>
					<li class="active-menu step-no"><a href="<? echo $this->Url('products')?>/add-product?product_id=<? echo $_GET['product_id'];?>"><span>1</span></a></li>
					<li class="indicator active-menu"><span></span></li>
					<li class="active-menu step-no"><a  href="<? echo $this->Url('products')?>/add-product-next?product_id=<? echo $_GET['product_id'];?>"><span>2</span></a></li>
					<li class="indicator active-menu"><span></span></li>
					<li  class="active-menu step-no"><a  href="<? echo $this->Url('products')?>/add-product-confirm?product_id=<? echo $_GET['product_id'];?>"><span>3</span></a></li>
				<?}else{?>
					<li class="active-menu step-no"><a href="<? echo $this->Url('products')?>/add-product"><span>1</span></a></li>
					<li class="indicator active-menu"><span></span></li>
					<li class="active-menu step-no"><a  href="<? echo $this->Url('products')?>/add-product-next"><span>2</span></a></li>
					<li class="indicator active-menu"><span></span></li>
					<li class="active-menu step-no"><a  href="<? echo $this->Url('products')?>/add-product-confirm"><span>3</span></a></li>
				<?}?>
			</ul>
		</div>
		<div class="middle-forms col-md-11">
			<form id="forms" method="post" class="form-horizontal" role="form">
				
					<? if(isset($_SESSION['user']['user_type']) && $_SESSION['user']['user_type']=="superadmin"){?>
					<div class="form-group">
						<label class="control-label col-sm-3">Admin</label>
							<div class="col-sm-9">
							<input readonly="readonly" type="text" value="<? echo $_SESSION['products']['admindropdown_name'];?>" class="form-control" id="admindropdown" name="admindropdown" placeholder="eg Select Admin" />
							<input  type="hidden" value="<? echo $_SESSION['products']['admin_user_id'];?>" id="admin_user_id" name="admin_user_id"/>
					</div></div>
					<?}?>					
					<div class="form-group">
						<label class="control-label col-sm-3">User</label>
							<div class="col-sm-9">
							<input readonly="readonly" type="text" value="<? echo $_SESSION['products']['userdropdown_name'];?>" class="form-control" id="userdropdown" name="userdropdown" />					
							<input  type="hidden" value="<? echo $_SESSION['products']['user_user_id'];?>" class="form-control" id="user_user_id" name="user_user_id"/>	</div>				
					</div>	
					<div class="form-group">
						<label class="control-label col-sm-3">Brand/Grade No</label>
						<div class="col-sm-9">
						<? if(isset($_SESSION['products']['brand']) && $_SESSION['products']['brand']!=""){?>
							<input readonly="readonly" type="text" value="<? echo $_SESSION['products']['brand'];?>" class="form-control" id="brand" name="brand" placeholder="eg Acranol 290D" />
						<?}else if(isset($this->productsDeatils->brandcode) && $this->productsDeatils->brandcode!=""){?>
							<input readonly="readonly" type="text" value="<?php echo $this->productsDeatils->brandcode;?>" class="form-control" id="brand" name="brand" placeholder="eg Acranol 290D" />
						<?}?></div>
					</div><span style="color:red" id="errorbrand"></span>
					<div class="form-group">
						<label class="control-label col-sm-3">Generic Name</label>
						<div class="col-sm-9">
						<? if(isset($_SESSION['products']['generic']) && $_SESSION['products']['generic']!=""){?>
							<input readonly="readonly" type="text"  value="<?php echo $_SESSION['products']['generic'];?>" class="form-control" id="generic" name="generic" placeholder="eg Styrene Acrylic Emulsion" />
						<?}else if(isset($this->productsDeatils->genericname) && $this->productsDeatils->genericname!=""){?>
							<input type="text" readonly="readonly" value="<?php echo $this->productsDeatils->genericname;?>" class="form-control" id="generic" name="generic" placeholder="eg Styrene Acrylic Emulsion" />
						<?}?></div>
					</div><span style="color:red" id="errorgname"></span>
					<div class="form-group">
						<label class="control-label col-sm-3">Function</label>
						<div class="col-sm-9">
						<? if(isset($_SESSION['products']['fuction']) && $_SESSION['products']['fuction']!=""){?>
							<input type="text"  readonly="readonly" value="<?php  echo $_SESSION['products']['fuction'];?>" class="form-control" id="fuction" name="fuction" placeholder="eg Binder, Defoamer, Biocide" />
						<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">Manufacturer</label>
						<div class="col-sm-9">
						<? if(isset($_SESSION['products']['manufacture']) && $_SESSION['products']['manufacture']!=""){?>
							<input readonly="readonly" type="text" value="<?php echo $_SESSION['products']['manufacture'];?>" class="form-control" id="manufacture" name="manufacture" placeholder="eg BASF" />
						<?}else if(isset($this->productsDeatils->fuction) && $this->productsDeatils->fuction!=""){?>
							<input type="text"  readonly="readonly" value="<?php  echo $this->productsDeatils->fuction;?>" class="form-control" id="fuction" name="fuction" placeholder="eg Binder, Defoamer, Biocide" />
						<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">Origin</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['products']['origin_name']) && $_SESSION['products']['origin_name']!=""){?>
								<input readonly="readonly" type="text" value="<? echo $_SESSION['products']['origin_name'];?>" class="form-control" id="origin_name" name="origin_name" placeholder="eg origin" />
								<input type="hidden" value="<? echo $_SESSION['products']['origin'];?>" id="origin" name="origin" placeholder="eg origin" />
							<?}?></div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-3">Categories</label>
							<div class="col-sm-9">
							<? if(isset($_SESSION['products']['category_name']) && $_SESSION['products']['category_name']!=""){?>
								<input readonly="readonly" type="text" id="category_name" name="category_name" class="form-control" value="<? echo $_SESSION['products']['category_name'];?>" placeholder="eg Categories " />
								<input type="hidden" id="category_id" name="category_id" value="<? echo $_SESSION['products']['category_id'];?>" placeholder="eg Categories " />
							<? } ?></div>
					</div>
						
							<div class="form-group">
								<label class="control-label col-sm-3">Selling</label>
								<div class="col-sm-9">
								<input readonly="readonly" type="text" class="form-control" value="<? echo $_SESSION['products']['selling'];?>" id="selling" name="selling" placeholder="eg Select" /></div>
							</div>	
							<div class="col_1 form-group">
								<label class="control-label col-sm-3">Qty</label>
								<div class="col-sm-3">
								<?if(isset($_SESSION['products']['qty'])){ ?>
									<input style="width:92px !important;" type="text" class="form-control" readonly="readonly" id="qty" name="qty" value="<? echo $_SESSION['products']['qty'];?>" placeholder="eg 1000"  />
								<?}else if(isset($this->productsDeatils->quntity)){?>
									<input style="width:92px !important;" type="text" class="form-control" readonly="readonly" id="qty" name="qty" value="<? echo $this->productsDeatils->quntity;?>" placeholder="eg 1000"  />
								<?}?></div>
								<label class="control-label col-sm-3">Units</label>
								<div class="col-sm-3">
								<? if(isset($_SESSION['products']['units'])){ ?>
									<input style="width:92px !important;" readonly="readonly" class="form-control" type="text" id="units" value="<? echo $_SESSION['products']['units'];?>" name="units" placeholder="eg Kg, Ltr"  />
								<?}else if(isset($this->productsDeatils->unites)){?>
									<input style="width:92px !important;" readonly="readonly" class="form-control" type="text" id="units" value="<? echo $this->productsDeatils->unites;?>" name="units" placeholder="eg Kg, Ltr"  />
								<?}?></div>
							</div>							
						<div class="form-group">
								<label class="control-label col-sm-3">Year</label>
								<div class="col-sm-9">
								<? if(isset($_SESSION['products']['year'])){?>
									<input type="text" id="year"  readonly="readonly" class="form-control" name="year" value="<? echo $_SESSION['products']['year'];?>" placeholder="year" />
								<?} else if(isset($this->productsDeatils->year_of_manufacture)){?>
									<input type="text" id="year"  readonly="readonly" class="form-control" name="year" value="<? echo $this->productsDeatils->year_of_manufacture;?>" placeholder="year" />
								<?}?></div>
						</div>
						<div class="form-group">
							<div class="col_1">
								<label class="control-label col-sm-3">Packing</label>
								<div class="col-sm-3">
								<? if(isset($_SESSION['products']['packing'])){ ?>
								<input style="width:92px !important;" readonly="readonly" class="form-control" type="text" id="packing" value="<? echo $_SESSION['products']['packing'];?>" name="packing" placeholder="eg 200"  />
								<?}else if(isset($this->productsDeatils->package)){?>
								<input style="width:92px !important;" readonly="readonly" class="form-control" type="text" id="packing" value="<? echo $this->productsDeatils->package;?>" name="packing" placeholder="eg 200"  />
								<?}?></div>
								<label class="control-label col-sm-3">per</label>
								<div class="col-sm-3">
								<? if(isset($_SESSION['products']['per'])){?>
									<input style="width:92px !important;" readonly="readonly"  class="form-control"  type="text" id="per" name="per" value="<? echo $_SESSION['products']['per'];?>" placeholder="eg Drum, Bag, Tote"  />
								<?} else if(isset($this->productsDeatils->per)){?>
									<input style="width:92px !important;" readonly="readonly"  class="form-control" type="text" id="per" name="per" value="<? echo $this->productsDeatils->per;?>" placeholder="eg Drum, Bag, Tote"  />
								<?}?></div>
							</div>							
						</div>
						<div class="form-group">
							
								<label class="control-label col-sm-3">Suggested Price</label>
								<div class="col-sm-3">
									<span class="form-control">
										<? if(isset($this->productsDeatils->user_currency) && $this->productsDeatils->user_currency){
											echo strtoupper($this->productsDeatils->user_currency);
										}else if(isset($_SESSION['products']['currency'])){
											echo strtoupper($_SESSION['products']['currency']);
										}else{ 
											echo 'INR';
										}?>
									</span>	
									</div>&nbsp;&nbsp;<div class="col-sm-3">
									<? if(isset($_SESSION['products']['tsh'])){?>
										<input type="text" readonly="readonly" id="tsh" name="tsh" class="form-control" value="<? echo $_SESSION['products']['tsh'];?>" placeholder="eg 600" />
									<?}else if(isset($this->productsDeatils->suggested_price)){?>
										<input type="text" readonly="readonly" id="tsh" name="tsh" class="form-control" value="<? echo suggested_price;?>" placeholder="eg 600" />
									<?}?>
								</div>
							
						</div>
						<? if(isset($_SESSION['products']['type']) && $_SESSION['products']['type']=='bid'){ ?>
						<div class="form-group">
							
								<label class="control-label col-sm-3">Min Price</label>
								<div class="col-sm-3">
									<span class="form-control"><? if(isset($this->productsDeatils->user_currency) && $this->productsDeatils->user_currency){
											echo strtoupper($this->productsDeatils->user_currency);
										}else if(isset($_SESSION['products']['currency'])){
											echo strtoupper($_SESSION['products']['currency']);
										}else{ 
											echo 'INR';
										}?>
									</span>
									</div>&nbsp;&nbsp;<div class="col-sm-3">
									<? if(isset($_SESSION['products']['tshm'])){?>
										<input type="text" readonly="readonly" id="tshm" class="form-control" value="<? echo $_SESSION['products']['tshm'];?>" name="tshm" placeholder="eg 500" />
									<?} else if($this->productsDeatils->min_price){?>
										<input type="text" readonly="readonly" id="tshm" class="form-control" value="<? echo $this->productsDeatils->min_price;?>" name="tshm" placeholder="eg 500" />
									<?}?>
								</div>
							
						</div>	
						<?}?>
						<? if(isset($this->productsDeatils->user_currency) && $this->productsDeatils->user_currency){
							$currency=strtoupper($this->productsDeatils->user_currency);
						}else if(isset($_SESSION['products']['currency'])){
							$currency= strtoupper($_SESSION['products']['currency']);
						}else{ 
							$currency='INR';
						}?>
						<input type="hidden" id="user_currency" name="user_currency" value="<? echo $currency;?>">			
						
						<div class="form-group">
								<label class="control-label col-sm-3">Type</label>
								<div class="col-sm-9">
								<? if(isset($_SESSION['products']['type']) && $_SESSION['products']['type']=='bid'){ ?>
									<input readonly="readonly" type="text" id="type_name" name="type_name" class="form-control" value="<? echo 'Sell or Bid';?>" placeholder="eg type " />
									<input type="hidden" id="type" name="type" value="<? echo $_SESSION['products']['type'];?>" placeholder="eg type " />
								<?}else if(isset($_SESSION['products']['type']) && $_SESSION['products']['type']=='buy'){?>
									<input readonly="readonly" type="text" id="type_name" name="type_name" class="form-control" value="<? echo 'Sell';?>" placeholder="eg type " />
									<input type="hidden" id="type" name="type" value="<? echo $_SESSION['products']['type'];?>" placeholder="eg type " />
								<?}?></div>
						</div>
						<div class="form-group">
								<? if(isset($_SESSION['products']['p_status']) && $_SESSION['products']['p_status']=='0' && isset($this->productsDeatils->product_id) && $this->productsDeatils->product_id!=""){ ?>
									<label class="control-label col-sm-3">Status</label>
									<div class="col-sm-9">
									<input readonly="readonly" type="text" id="p_status_name" name="p_status_name" class="form-control" value="<? echo 'Pending';?>" placeholder="eg Status " />
									<input type="hidden" id="p_status" name="p_status" value="<? echo $_SESSION['products']['p_status'];?>" placeholder="eg Status " /></div>
								<?}else if(isset($_SESSION['products']['p_status']) && $_SESSION['products']['p_status']=='1'){?>
									<label class="control-label col-sm-3">Status</label>
									<div class="col-sm-9">
									<input readonly="readonly" type="text" id="p_status_name" name="p_status_name"  class="form-control" value="<? echo 'Active';?>" placeholder="eg Status " />
									<input type="hidden" id="p_status" name="p_status" value="<? echo $_SESSION['products']['p_status'];?>" placeholder="eg Status " /></div>
								<?}else if(isset($_SESSION['products']['p_status']) && $_SESSION['products']['p_status']=='2'){?>
									<label class="control-label col-sm-3">Status</label>
									<div class="col-sm-9">
									<input readonly="readonly" type="text" id="p_status_name" name="p_status_name" class="form-control" value="<? echo 'Inactive';?>" placeholder="eg Status " />
									<input type="hidden" id="p_status" name="p_status" value="<? echo $_SESSION['products']['p_status'];?>" placeholder="eg Status " /></div>
								<?}?>
						</div>	
						<input type="hidden" id="hid_product_id" name="hid_product_id" value="<? if(isset($this->productsDeatils->product_id)){ echo $this->productsDeatils->product_id;}?>"/>
						<input type="hidden" id="hid_product_user_id" name="hid_product_user_id" value="<? if(isset($this->productsDeatils->user_id)){ echo $this->productsDeatils->user_id;}?>">
						<div class="adding_list form-group">
							<div class="col-sm-3">&nbsp;</div>
						<div class="col-sm-9">
								
									<?if(isset($_GET['product_id']) && $_GET['product_id']!=""){?>
										<a class="back_btn btn btn-danger" href="<? echo $this->Url('products')?>/add-product-next?product_id=<? echo $_GET['product_id'];?>" role="button">Back</a>
								   <?} else{?>
								   	 <a class="back_btn btn btn-danger" href="<? echo $this->Url('products')?>/add-product-next" role="button">Back</a></li>
								   <?}?>
								   <a class="btn btn-danger" onclick="return submitValues();" value="submit" role="button">Submit</a>								 
									<div id="loading" style="display:none;float:right;margin-right:30px;"><img src="<?php echo $this->basePath() ?>/images/loading_image.gif" /></div>
								</div>
							
						</div>
			</form>
		</div>
	 </div>
</div></div>
<script>
	function submitValues(){
		$("#loading").show();
	    $("#forms").submit();
	}
</script>
<?php }else{?>
<script>
	window.location='<? echo $this->Url('home')?>';
</script>
<?php }?>